import request from '@/utils/request'

export function getList(params) {
  return request({
    url: '/vue-admin-template/table/list',
    method: 'get',
    params
  })
}
// 新闻查询接口
export const getNews = (params) =>{
  return request({
      url:'api/news',
      method:'get',
      params
  })
}
// 新闻添加接口
export const postNews = (params) =>{
  return request({
      url:'api/news',
      method:'post',
      data:params
  })
}
// 新闻编辑接口
export const putNews = (params) =>{
  return request({
      url:`api/news/${params.id}`,
      method:'put',
      data:params
  })
}
// 新闻删除接口
export const deleteNews = (params) =>{
  return request({
      url:`api/news/${params}`,
      method:'delete',
      data:params
  })
}
// 类别查询接口
export const getCate = (params) =>{
  return request({
      url:'api/category',
      method:'get',
      params
  })
}
// 类别添加接口
export const postCate = (params) =>{
  return request({
      url:'api/category',
      method:'post',
      data:params
  })
}
// 类别编辑接口
export const putCate = (params) =>{
  return request({
      url:`api/category/${params.id}`,
      method:'put',
      data:params
  })
}
// 类别删除接口
export const deleteCate = (params) =>{
  return request({
      url:`api/category/${params}`,
      method:'delete',
      data:params
  })
}

// 图片添加接口
export const postupLoad = (params) =>{
  return request({
      url:'api/uploadPicture',
      method:'post',
      data:params
  })
}
// 手机产品查询
export const getProduce = (params) =>{
  return request({
      url:'api/product',
      method:'get',
      params
  })
}
// 手机产品添加
export const postProduce = (params) =>{
  return request({
      url:'api/product',
      method:'post',
      data:params
  })
}
// 手机产品编辑
export const putProduce = (params) =>{
  return request({
      url:`api/product/${params.id}`,
      method:'put',
      data:params
  })
}
// 手机产品删除
export const deleteProduce = (params) =>{
  return request({
      url:`api/product/${params}`,
      method:'delete',
      data:params
  })
}
// 管理员查询接口
export const getAdminSer = (params) =>{
  return request({
      url:'/api/adminuser',
      method:'get',
      params
  })
}
// 管理员添加接口
export const getAdminAdd = (params) =>{
  return request({
      url:'/api/adminuser',
      method:'post',
      data:params
  })
}
// 管理员编辑接口
export const getAdminEdit = (params) =>{
  return request({
      url:`/api/adminuser/${params.id}`,
      method:'put',
      data:params
  })
}
// 管理员删除接口
export const getAdminDel = (params) =>{
  return request({
      url:`/api/adminuser/${params}`,
      method:'delete',
      data:params
  })
}

//用户点评查看接口
export const getCommentSer= (params) =>{
  return request({
      url:'/api/comment',
      method:'get',
     params
  })
}
//用户点评添加接口
export const getCommentAdd= (params) =>{
  return request({
      url:'/api/comment',
      method:'post',
      data:params
  })
}
//用户点评编辑接口
export const getCommentEdit= (params) =>{
  return request({
      url:`/api/comment/${params.id}`,
      method:'put',
      data:params
  })
}
//用户点评删除接口
export const getCommentDel= (params) =>{
  return request({
      url:`/api/comment/${params}`,
      method:'delete',
      data:params
  })
}